import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        list: ['吃饭', '睡觉']
    },
    getters: {},
    mutations: {
        adds(state, val) {
            state.list.push(val);
        }
    },
    actions: {
        addList(content, val) {
            console.log(content);
            console.log(val);
            content.commit('adds', val);
        }
    },
    modules: {}
});
